/**
 * 视频播放历史记录相关接口
 */
import request from '@/config/request'
import type { CvVideoHistorySaveReqVO, CvVideoHistorySearchReqVO } from '@/types/history'

/**
 * 获取视频播放历史记录
 */
export const getVideoHistory = (videoId: number) => {
  return request.get({ url: '/platform/video/history/detail', params: { videoId } })
}

/**
 * 保存视频播放历史记录
 */
export const saveVideoHistoryRecord = (data: CvVideoHistorySaveReqVO) => {
  return request.post({ url: '/platform/video/history/save', data })
}

/**
 * 删除视频播放历史记录
 */
export const deleteVideoHistoryRecord = (videoId: number) => {
  return request.delete({ url: '/platform/video/history/delete?', params: { videoId } })
}

/**
 * 清空视频播放历史记录
 */
export const clearVideoHistoryRecord = () => {
  return request.delete({ url: '/platform/video/history/clear' })
}

/**
 * 获取视频播放历史记录分页数据列表
 */
export const getVideoHistoryRecordPage = (reqVO: CvVideoHistorySearchReqVO) => {
  return request.get({ url: '/platform/video/history/page', params: reqVO })
}
